package com.fintech.third.service.moxie;

import com.fintech.third.model.moxie.chsi.EducationInfoList;
import com.fintech.third.model.moxie.chsi.StudentInfoList;
import com.fintech.third.service.moxie.task.TaskCreateReq;
import com.fintech.third.service.moxie.task.TaskCreateRsp;
import com.fintech.third.service.moxie.task.TaskStatusRsp;
import com.fintech.third.service.moxie.task.TaskVoidRsp;
import com.fintech.third.service.moxie.task.UserInput;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;

/**
 * 学信网
 */
public interface ChsiApi {
    /**
     * 创建任务
     *
     * @param req
     * @return
     */
    @POST("/chsi/v2/tasks")
    Call<TaskCreateRsp> createTask(@Body TaskCreateReq req);

    /**
     * 查询任务状态
     *
     * @param taskId
     * @return
     */
    @GET("/chsi/v2/tasks/{taskid}/status")
    Call<TaskStatusRsp> getTaskStatus(@Path("taskid") String taskId);

    /**
     * 输入验证码
     *
     * @param taskId
     * @param req
     * @return
     */
    @POST("/chsi/v2/tasks/{taskid}/input")
    Call<TaskVoidRsp> input(@Path("taskid") String taskId, @Body UserInput req);

    /**
     * 获取学历
     *
     * @param taskId
     * @return
     */
    @GET("/chsi/v2/educations/{taskid}/education")
    Call<EducationInfoList> getEducationInfo(@Path("taskid") String taskId);

    /**
     * 获取学籍
     *
     * @param taskId
     * @return
     */
    @GET("/chsi/v2/students/{taskid}/student")
    Call<StudentInfoList> getStudentInfo(@Path("taskid") String taskId);
}
